<?php
require_once('Api/nusoap/nusoap.php');

/**
 * Description of UMSSMS
 *
 * @author Administrator
 */
class UMSSMS {
    /*
     * 网关URL
     */
    var $url="";
    /*
     * 企业代号
     */
    var $spcode="";
    /*
     * 用户名
     */
    var $username="";
    /*
     * 密码
     */
    var $password="";
    /**
    * webservice客户端
    */
    var $soap;
    
    /*
     * 初始化类
     */
    function UMSSMS($url,$spcode,$username,$password){
        $this->url=$url;
        $this->spcode=$spcode;
        $this->username=$username;
        $this->password=$password;
        /**
         * 初始化 webservice 客户端
         */	

        $this->soap = new nusoap_client($url,true); 
        $this->soap->soap_defencoding ='utf-8';
        $this->soap->decode_utf8 = false;	
        
        
        
    }
    /*
     * 发送短信
     */
    function sendSMS($mobiles,$content,$addSerial)
    {
        $params = array('in0'=>$this->spcode,'in1'=>$this->username,'in2'=>  $this->password,
			'in3'=>$content,'in4'=>$mobiles, 'in5'=>$addSerial,'in6'=>"",'in7'=>"1",'in8'=>"",'in9'=>"",'in10'=>""
			);
        $result = $this->soap->call("Sms",$params,$this->url);
        return $result;
      
    }

}
